<template>
  <div id="app" class="app shui">
    <KButton type="warn" @click="showDialog">警告类操作</KButton>
    <KDialog
      v-model="diaShow"
      :buttons="diaBtn"
      title="零度的田"
      desc="弹窗内容，告知当前状态、信息和解决方法，描述文字尽量控制在三行内"
    />
    <!-- wx-component 标签用法 -->
    <wx-component behavior="picker" mode="region" @change="onChange"
      >选择城市</wx-component
    >
    <wx-component behavior="button" open-type="share" @click="onClickShare"
      >分享</wx-component
    >

    <!-- wx- 前缀用法 -->
    <wx-picker mode="region" @change="onChange">选择城市</wx-picker>
    <wx-button class="share-btn" open-type="share" @click="onClickShare">分享</wx-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      diaShow: false,
      diaBtn: [
        {
          text: '确定',
          click: () => {
            console.log('确定');
            this.diaShow = false;
          }
        }
      ]
    };
  },
  methods: {
    showDialog() {
      this.diaShow = !this.diaShow;
    },
    onChange() {
      //
    },
    onClickShare(res) {
      console.log(res);
    }
  }
};
</script>
<style>
.app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.share-btn {
  background: deepskyblue;
  padding: 5px 10px;
  color: #fff;
}
</style>
